﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Kosmos
{
    class CreditsMenuScreen : MenuScreen
    {

        #region Fields

        string text;
        MenuEntry backMenuEntry;

        #endregion

        #region Initialization

        public CreditsMenuScreen()
            : base("Credits",false)
        {
            text = "Encadrant:\n\n" +
                "Michel Buffa\n\n" +
                "Membres:\n\n" +
                "Biehler Maxime\n" +
                "Botta Baptiste\n" +
                "Giraud Romain\n" +
                "Moussalli Maximilien\n\n"+
                "Polytech Nice-Sophia 2009/2010";
            backMenuEntry = new MenuEntry("Back");

            backMenuEntry.Selected += OnCancel;
            MenuEntries.Add(backMenuEntry);

        }

        #endregion

        #region Draw

        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            SpriteFont font = ScreenManager.Font;

            // Center the message text in the viewport.
            Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
            Vector2 viewportSize = new Vector2(viewport.Width, viewport.Height);
            Vector2 textSize = font.MeasureString(text);
            Vector2 textPosition = (viewportSize - textSize) / 2;

            // Fade the popup alpha during transitions.
            Color color = new Color(255, 255, 255, TransitionAlpha);

            // Draw the message box text.

            spriteBatch.Begin();
            
            spriteBatch.DrawString(font, text, textPosition, color);

            spriteBatch.End();
        }

        #endregion
    }
}
